package cn.stronglink.asset.module.space.controller;

import java.util.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.baomidou.mybatisplus.plugins.Page;

import cn.stronglink.asset.module.space.service.SpaceService;
import cn.stronglink.asset.module.space.vo.SpaceVo;
import cn.stronglink.suite.core.base.AbstractController;

@Controller
@RequestMapping(value = "space")
@SuppressWarnings("unchecked")
public class SpaceController extends AbstractController {

	@Autowired
	private SpaceService spaceService;
	
	//获取空间列表数据
	@RequestMapping(value = "queryList")
	public ResponseEntity<ModelMap> queryList(ModelMap modelMap, HttpServletRequest request,
			HttpServletResponse response, @RequestBody Map<String, Object> params) {
		Page<SpaceVo> page = (Page<SpaceVo>) super.getPage(params);
		Page<SpaceVo> data = spaceService.queryHardList(page,params);
		return setSuccessModelMap(modelMap, data);
	}
	
	@RequestMapping(value = "getRoomInfo")
	public ResponseEntity<ModelMap> getRoomInfo(ModelMap modelMap, HttpServletRequest request,
			HttpServletResponse response, @RequestBody Map<String, Object> params) {	
		List<SpaceVo> data = spaceService.getRoomInfo(params);
		return setSuccessModelMap(modelMap, data);
	}
}
